package com.niit;

import com.niit.config.MyConfig;
import com.niit.service.Dept;
import com.niit.service.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestAOP {
    public static void main(String[] args) {

        //ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-beans.xml");
        ApplicationContext ctx = new AnnotationConfigApplicationContext(MyConfig.class);

        User user = ctx.getBean(User.class);
        user.addUser("张三");
        user.deleteUser("张三");

        Dept dept = ctx.getBean(Dept.class);
        dept.addDept("技术部");
    }
}
